var pattern = {
    get: function () {
        return "I alway return this string,whatever you have assigned";
    },
    set: function () {
        this.myname = "this is my name string";
    },
};

function TestDefineSetAndGet() {
    Object.defineProperty(this, "myproperty", pattern);
}

var instance = new TestDefineSetAndGet();
instance.myproperty = "test";

// 'I alway return this string,whatever you have assigned'
console.log(instance.myproperty);

// 'this is my name string'
console.log(instance.myname);
